﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;

namespace Com.CMS263.DAO
{
    public  class MessageBoardDAO:BaseService
    {
        /// <summary>
        /// 查询总条数
        /// </summary>
        /// <returns></returns>
        public int GetCount()
        {
            string hql = "select count(*) from MessageBoard";           
            return Convert.ToInt32(GetValue(hql));
        }
        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="CurrentIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IList<MessageBoard> getGetListByPage(int CurrentIndex, int pageSize)
        {

            string hql = "from MessageBoard where 1=1 ";           
            hql += "  order by Id desc";
            return FindList<MessageBoard>(hql, null, (CurrentIndex - 1) * pageSize, pageSize);
        }
    }
}
